<!DOCTYPE html>
<html lang="zh-Hans">


<head>
    <title>机票查询订购系统</title>
        <!-- meta -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- css -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- js -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="http://huangkun123.com/static/admin/js/layui.js"></script>
    <script src="http://huangkun123.com/static/admin/js/jquery-1.12.4.min.js"></script>
    <link rel="stylesheet" href="http://huangkun123.com/static/admin/css/layui.css">
</head>
<form>

<div class="container" style="background: #f2f2f2;padding-bottom: 150px;">
    <div class="jumbotron" style="background: #009688;">
        <p style="text-align: center;">机票查询订购系统</p>
         <div class="user_status" style="float: left;">
            <a href="#" >角色：普通用户</a>
        </div>
        <div style="float: right;">

            <a href="/user/index" >首页&nbsp&nbsp</a>
            <a href="/user/show_order" >我的订单&nbsp&nbsp</a>
            <a href="/user/info" >个人中心&nbsp&nbsp</a>
        <a href="/user/login_out">退出登陆</a>
        </div>
        </div>


    <br>
    <br>
    <br>


   <div class="order_detail" style="font-size: 16px;">
        <div style="text-align: center;">
      <label style="text-align: center;font-size:20px;margin-bottom: 20px;">填写订单信息</label>

    </div>
        <blockquote class="layui-elem-quote layui-quote-nm">

    <label >始发时间：{{context.tickets.time_start}}</label>
   &nbsp--
    <label >{{context.tickets.time_arrived}}</label>
    &nbsp&nbsp&nbsp|
    <label >到达地：{{context.tickets.start}}</label>
    &nbsp&nbsp&nbsp--
    <label >{{context.tickets.arrived}}</label>
    &nbsp&nbsp&nbsp|
    <label >班次：{{context.tickets.num}}</label>
    &nbsp&nbsp&nbsp|
    <label >票价：{{context.tickets.price}}</label>
   </div>
        </blockquote>
<form method="post" action="/write_order/">
    <input style="display:none" name="num" value="{{context.tickets.num}}">
    <input style="display:none" name="time_start" value="{{context.tickets.time_start}}">
    <input style="display:none" name="arrived" value="{{context.tickets.arrived}}">
    <div class="user_detail">
        <br>
        <br>
         <div class="layui-field-box" >
        <input style="display:none" name="tk_id" value="{{context.ticket_id}}">
        <label >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp姓名</label>
      <div class="layui-input-inline">
        <input type="tel" name="name" lay-verify="required|phone" autocomplete="off" class="layui-input" placeholder="填写姓名">
      </div>
        <br>
        <br>
        <label >手机号码</label>
      <div class="layui-input-inline">
        <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input" placeholder="填写手机号">
      </div>
        <br>
        <br>

         <label >身份证号</label>
      <div class="layui-input-inline">
        <input type="tel" name="id_card" lay-verify="required|phone" autocomplete="off" class="layui-input" placeholder="填写身份证号" style="width:300px">
      </div>

    </div>
    </div>


    <br>
    <br>

        <blockquote class="layui-elem-quote">
            <div>
                <label style="float:left">健康状况调查：</label>
            <label style="float:right">否&nbsp&nbsp&nbsp是</label>
            </div>

        <br>
          <br>
        <label style="float:left">最近是否有感冒发烧现象或者最近14天去过疫情高发地区？</label>
         <div class="layui-input-block" style="float:right">
      <input type="radio" name="jk" value="1" title="否" checked="">
      <input type="radio" name="jk" value="0" title="是">



    </div>

    </blockquote>

    <div style="text-align: center;margin-top:100px">
        <button type="submit" class="layui-btn layui-btn-warm layui-btn-radius" id="tjdd" style="background-color: #006bffba;" >提交订单</button>
    </div>




</div>
</form>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;

  //日期
  laydate.render({
    elem: '#date'
  });
  laydate.render({
    elem: '#date1'
  });

  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');

  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [
      /^[\S]{6,12}$/
      ,'密码必须6到12位，且不能出现空格'
    ]
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });

  //监听指定开关
  form.on('switch(switchTest)', function(data){
    layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
      offset: '6px'
    });
    layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
  });

  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });

  //表单赋值
  layui.$('#LAY-component-form-setval').on('click', function(){
    form.val('example', {
      "username": "贤心" // "name": "value"
      ,"password": "123456"
      ,"interest": 1
      ,"like[write]": true //复选框选中状态
      ,"close": true //开关状态
      ,"sex": "女"
      ,"desc": "我爱 layui"
    });
  });

  //表单取值
  layui.$('#LAY-component-form-getval').on('click', function(){
    var data = form.val('example');
    alert(JSON.stringify(data));
  });

});
</script>
<script>
<!--    $('#tjdd').click(function(){-->
<!--        alert('火车票预定成功！')-->
<!--    })-->
</script>
</body>
</html>